package com.hubu.oop.polymorphism;

public class Test {
	public static void testAnimalVoice(Animal c) {
		c.voice();
		if(c instanceof Cat) {
			((Cat) c).catchMouse();
		}
	}
	
	public static void main(String[] args) {
		Animal c = new Cat();
		Animal a = new Dog();
		testAnimalVoice(c);
		testAnimalVoice(a);
		
		Dog a2 = (Dog)a;
		a2.seeDoor();
	}
}
